import Vue from 'vue';
import VueRouter from 'vue-router';
import CampusBinhai from '../views/CampusBinhai.vue';
import CampusChashan from '../views/CampusChashan.vue';
import CampusYueqing from '../views/CampusYueqing.vue';
import StudentSystem from '../views/StudentSystem.vue';

Vue.use(VueRouter);

const routes = [
  {
    path: '/',
    name: 'campus-binhai',
    component: CampusBinhai
  },
  {
    path: '/chashan',
    name: 'campus-chashan',
    component: CampusChashan,
    children: [
      { path: 'building5', component: () => import('../views/Building5.vue') },
      { path: 'building6', component: () => import('../views/Building6.vue') },
      { path: 'building7', component: () => import('../views/Building7.vue') }
    ]
  },
  {
    path: '/yueqing',
    name: 'campus-yueqing',
    component: CampusYueqing
  },
  {
    path: '/studentsystem',
    name: 'student-system',
    component: StudentSystem
  }
];

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
});

export default router;